/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface ShopCusYeQc extends BasicModel<ShopCusYeQc> {
  ddate?: string; // 期初日期
  cusCode?: string; // 客户编码
  imoney?: string; // 期初金额
  createByName?: string; // 创建人名称
  updateByName?: string; // 修改人名称
}

export const shopCusYeQcList = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/list', params });

export const shopCusYeQcListData = (params?: ShopCusYeQc | any) =>
  defHttp.post<Page<ShopCusYeQc>>({ url: adminPath + '/shop/cus/shopCusYeQc/listData', params });

export const shopCusYeQcForm = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/form', params });

export const shopCusYeQcSave = (params?: any, data?: ShopCusYeQc | any) =>
  defHttp.postJson<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/save', params, data });

export const shopCusYeQcImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/shop/cus/shopCusYeQc/importData',
      onUploadProgress,
    },
    params,
  );

export const shopCusYeQcDelete = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/delete', params });

export const shopCusYeQcConfirm = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/confirm', params });

export const shopCusYeQcCancel = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/cancel', params });

export const shopCusYeQcBatchDel = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/batchDelete', params });

export const shopCusYeQcEnableAll = (params?: ShopCusYeQc | any) =>
  defHttp.get<ShopCusYeQc>({ url: adminPath + '/shop/cus/shopCusYeQc/enableAll', params });
